package com.mask.im.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mask.im.business.model.dto.AdminGroupChatMessageDTO;
import com.mask.im.business.model.dto.GroupChatMessageDTO;
import com.mask.im.business.model.entity.chat.IMGroupChatMessageDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;


/**
 * 群聊天记录
 *
 * @author jian
 */
@Mapper
@Repository
public interface IMGroupChatMessageMapper extends BaseMapper<IMGroupChatMessageDO> {

    List<GroupChatMessageDTO> getBeforeLeaveGroupChatMessage(@Param("groupChatId") Long groupChatId,
                                                             @Param("backTime") Date backTime);

    List<GroupChatMessageDTO> getLeaveGroupChatMessage(@Param("groupChatId") Long groupChatId);

    List<IMGroupChatMessageDO> getVisibleRecords(@Param("groupChatId") Long groupChatId,
                                               @Param("userInfoId") Long userInfoId);

    Integer groupChatListCount(@Param("groupChatName") String groupChatName,
                               @Param("createTime") String createTime);

    List<AdminGroupChatMessageDTO> groupChatMessage(@Param("groupChatName") String groupChatName,
                                                    @Param("createTime") String createTime,
                                                    @Param("currentPage") long currentPage,
                                                    @Param("size") long size);
}

